package peng.service.impl;

import org.springframework.stereotype.Service;
import peng.dao.AdminUserGroupMenuMapper;
import peng.entity.AdminUserGroupMenuKey;
import peng.service.AdminUserGroupMenuService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminUserGroupMenuServiceIpml implements AdminUserGroupMenuService {
    @Resource
    private AdminUserGroupMenuMapper adminUserGroupMenuMapper;

    @Override
    public int deleteByPrimaryKey(Integer gid, Integer mid) {
        return adminUserGroupMenuMapper.deleteByPrimaryKey(gid, mid);
    }

    @Override
    public int insertSelective(AdminUserGroupMenuKey record) {
        return adminUserGroupMenuMapper.insertSelective(record);
    }

    @Override
    public int updateSelective(AdminUserGroupMenuKey record) {
      //  System.out.println("-------------------------"+record.getMid()+"-------------------"+record.getGid());
        int gid=record.getGid();
        int mid=record.getMid();
        int newMid=record.getUmid();
        return adminUserGroupMenuMapper.updateSelective(mid,gid,newMid);
    }

    @Override
    public List<AdminUserGroupMenuKey> showlist(Integer gid) {
        return adminUserGroupMenuMapper.showlist(gid);
    }

    @Override
    public int deleteGroupMen(Integer gid) {
        return adminUserGroupMenuMapper.deleteGroupMen(gid);
    }

}
